@echo off
echo ================================================
echo 启动手语识别系统 - Sign Language Recognition System
echo ================================================

:: 设置控制台编码为UTF-8
chcp 65001 > nul

:: 确认是否要启动服务器和客户端
echo 此脚本将启动手语识别服务器和摄像头客户端
echo This script will start both server and camera client
echo.
echo 请确保您的摄像头已连接并正常工作
echo Please make sure your camera is connected and working
echo.
set /p confirm=是否继续？(Y/N): 

if /i not "%confirm%"=="Y" (
    echo 操作已取消
    echo Operation cancelled
    goto :end
)

:: 创建一个新的命令提示符窗口来运行服务器
echo.
echo 正在启动服务器...
echo Starting server...
start cmd /k "title 手语识别服务器 && cd /d %~dp0 && python SLR_flask_server.py"

:: 等待几秒钟，确保服务器已经启动
echo 等待服务器启动...（5秒）
echo Waiting for server to start... (5 seconds)
timeout /t 5 /nobreak > nul

:: 启动摄像头客户端
echo.
echo 正在启动摄像头客户端...
echo Starting camera client...
python camera_client.py

:end
echo.
echo 程序已结束
echo Program ended
pause
